//
//  hello.m
//  Hello World
//
//  Created by Alpha.L Cheng on 9/7/13.
//  Copyright (c) 2013 tomatoeskit.org. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#include <stdio.h>

@interface Robot : NSObject
{
    NSString *robotName;
}
-(Robot *)init:(NSString *)thisRobotName;
-(void)sayHello:(NSString *)timeNow;
+(void)sayGoodBye:(NSString *)timeNow;
@end

@implementation Robot
-(Robot *)init:(NSString *)thisRobotName
{
    self = [super init];
    if(self)
        robotName = thisRobotName;
    return  self;
}
-(void)sayHello:(NSString *)timeNow
{
    printf("This is robot %s. It's %s now.\n", [robotName UTF8String], [timeNow UTF8String]);
}
+(void)sayGoodBye:(NSString *)timeNow
{
    printf("It's %s. Time to say goodbye!\n", [timeNow UTF8String]);
}
@end

int main(void)
{
    Robot *robot = [[Robot new] init:@"Robot Zeta"];
    [robot sayHello:@"Two O'Clock"];
    [Robot sayGoodBye:@"Nine O'Clock"];
}